package cn.sccl.dirms.security.model;

import cn.sccl.common.model.BaseModel;
import cn.sccl.common.exception.BusinessException;

/**
* 角色
* 数据库表 T_SEC_ROLE 的实体对象
* Created by 杨浩宇 on 2016-07-25.
*/
public class Role extends BaseModel{
/**
*表名
*/
public final static String TABLE_NAME ="t_sec_role";

    private java.lang.String name;//名称
    private java.lang.String note;//备注
    private boolean active;//是否可用（1可用，0禁用）

    public void setName(java.lang.String name){
    this.name = name;
    }

        public java.lang.String getName(){
    return this.name;
    }
    public void setNote(java.lang.String note){
    this.note = note;
    }

        public java.lang.String getNote(){
    return this.note;
    }
    public void setActive(boolean active){
    this.active = active;
    }

        public boolean isActive(){
    return this.active;
    }

/**
* clone一个对象。
* @param cls 需要克隆的对象类型，只能是当前类的子类
* @param
<T>
    * @return
    * @throws IllegalAccessException
    * @throws InstantiationException
    */
    public
    <T extends Role> T clone(Class
        <T> cls) {
            try {
            T t = cls.newInstance();
            t.setId(this.
            getId());
            t.setName(this.
            getName());
            t.setCreateTime(this.
            getCreateTime());
            t.setUpdateTime(this.
            getUpdateTime());
            t.setDeleteFlag(this.isDeleteFlag());
            t.setNote(this.
            getNote());
            t.setActive(this.isActive());
            return t;
            } catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException("对象克隆失败，请克隆的目标对象是否具有无参的构造函数。", e.getCause());
            }
            }
            }